package com.groupbuying.payproducer.connector;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @Author: m
 * @Description:
 * @Date: Create in 16:29 2019/10/22
 */
@Service
@FeignClient("service-sysconfig")
public interface WechatAliFeign {

    /**
     * 通过code获取小程序的openID和sessionKey
     */
    @GetMapping(value = "/Wechat/weChatMiniApp/getOpenidAndSessionKeyByCode")
    Map<String, String> getOpenidAndSessionKeyByCode(@RequestParam("code") String code, @RequestParam("indicate") String indicate);

    /**
     * 支付宝用户认证授权获取alipayUserId和accessToken
     *
     * @param authCode
     * @return map
     * @throws Exception
     */
    @GetMapping("/aliMiniApp/aliGetUserIdAccessCodeByAuthCode")
    Map<String, String> aliGetUserIdAccessCodeByAuthCode(@RequestParam("authCode") String authCode, @RequestParam("indicate") String indicate) throws Exception;

}
